<!DOCTYPE html>

<html>

<head>
    <meta charset="utf-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=Edge,chrome=1" />
    <title>xhr.send(FormData) Example</title>
</head>

<body>


    <div class="">

        <td>多个上传:</td>
        <td><input class="mongo-gridfs-upload" type="file" multiple/></td>
        <table>
            <tr>
                <td></td>
            </tr>
        </table>

        <td>单个上传:</td>
        <td><input class="mongo-gridfs-upload" type="file" /></td>

        <input type="button" onclick="test();" value="提交" />
    </div>





    <input type="button" onclick="del();" value="del" />
    <script src="http://cdn.static.runoob.com/libs/jquery/1.10.2/jquery.min.js">
    </script>

    <script src="mongo-gridfs-upload.js">
    </script>
    <script>
        function del() {

            $.ajax({
                type: "post",
                url: "http://localhost:8088/mongo-temp/delete",
                dataType: "json",
                data: {
                    "id": "d5c80c88c6984f3fa286026c036da4d2"
                },
                success: function(data) {
                    alert("111");
                },
                error: function(data) {
                    console.debug(data);
                },
                complete: function(data) {
                    console.debug(data);
                }
            });
        }



        function uploadCall(data) {
            alert(data.msg);
        }

        function test() {

            //MongoGridfsUpload.upload("http://localhost:8088/mongo-grid/upload", uploadCall);
            MongoGridfsUpload.upload("http://localhost:8088/mongo-temp/upload", uploadCall);
        }
    </script>





</body>

</html>